<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://eureka.yigolden.net/stringutils/sutaglib/1.0" prefix="su"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link type="text/css" href="${staticResources}/css/listbook.css" rel="stylesheet" />
<script type="text/javascript" src="${staticResources}/js/ajax.js"></script>
<script type="text/javascript">
function collect(beid)
{
	//var redirect_url = document.getElementById("redirect_url").value;
	var mode = "ajax";
	
	var params="beid=" + encodeURIComponent(beid);
	//params+="&redirect_url="+encodeURIComponent(redirect_url);
	params+="&mode="+encodeURIComponent(mode);

	doAjax("AddToFavorite"
			,params,function(rst){
	var rst=eval('(' +rst+ ')');
	if(rst.status == 0)
	{
		window.alert("成功加入收藏夹！");
	}
	else 
	{
		window.alert(rst.message);
	} 
	});
}
</script>	
</head>

<body>
<div id="header">
  <div id="hy">
    <div id="logo">欢迎光临中国药科大学二手书交易平台!请<a href="#">登录</a> 免费<span><a href="#">注册</a></span></div>
    <div id="sc">
      <ul>
        <li><a href="#">收藏夹</a></li>
        <li><a href="#">我的账单</a></li>
        <li><a href="#">交易快照</a></li>
      </ul>
    </div>
    
    
  </div>
  <div id="top"><img src="${staticResources}/image/zhuye_04.gif" width="1024" height="153" alt=""></div>
  <div id="nav" style="background:url(${staticResources}/image/zhuye_06.gif)">
    <ul>
      <li><a href="#">首页</a></li>
      <li><a href="#">新书上架</a></li>
      <li><a href="#">交易广场</a></li>
      <li><a href="#">拍卖中心</a></li>
      <li><a href="#">读者推荐</a></li>
      <li><a href="#">书籍论坛</a></li>
      <li><a href="#">新手指南</a></li>
    </ul>
  </div>
</div>
<!--头部结束-->
<div class="main">
     <div class="lmain"><span><img src="${staticResources}/image/zhuye_10.gif" width="179" height="35" alt=""></span>
        <dl class="tsfl">
           
           <dd> <a href="#">小说 </a></dd>
           <dt><a href="#"> 言情 武侠 名著 军事 悬疑 职场</a></dt>
           <dd><a href="#"> 期刊</a></dd>
           <dt><a href="#"> 财经 漫画 英文 杂志</a></dt>
           <dd><a href="#">文学</a></dd>
           <dt><a href="#"> 诗歌 散文 文集 外国诗歌</a></dt>
           <dd><a href="#"> 教科书             </a></dd>
           <dt><a href="#">化学 物理 生物 英语 计算机 药理</a></dt>
           <dd><a href="#"> 教辅用书</a></dd>
           <dt><a href="#"> 药院 中药院 商院 生科院 理学院</a></dt>
           <dd><a href="#"> 人文社科</a></dd>
           <dt><a href="#"> 商务礼仪 宗教 历史 法律 心理学</a></dt>
           <dd><a href="#"> 艺术</a></dd>
           <dt><a href="#"> 摄影 绘画 音乐 舞蹈 书法 篆刻</a></dt>
           <dd><a href="#"> 成功励志</a></dd>
           <dt><a href="#"> 礼仪 人际交往 口才 留学 哲学</a></dt>
           <dd><a href="#"> 其他</a></dd>
           <dt><a href="#">...</a></dt>
         </dl>
         <dl class="phb">
            <span><img src="${staticResources}/image/zhuye_37.gif" width="177" height="35" alt=""></span>
            <div id="nn">
               <ul>
            <li><a href="#">教科</a></li>
            <li><a href="#">小说</a></li>
            <li><a href="#">期刊</a></li>
            <li><a href="#">其他</a></li>
               </ul>
            </div>
          <dd><a href="#"><img src="${staticResources}/image/zhuye_43.gif" width="64" height="74" alt="">书名：<br>价格：<br>卖家信息：</a>          </dd>
          <dd><a href="#"><img src="${staticResources}/image/zhuye_43.gif" width="64" height="74" alt="">书名：<br>价格：<br>卖家信息：</a>          </dd>
          <dd><a href="#"><img src="${staticResources}/image/zhuye_43.gif" width="64" height="74" alt="">书名：<br>价格：<br>卖家信息：</a>          </dd>
        </dl>
     </div>
  <div class="rmain">
	     <dl><img src="${staticResources}/image/listbook_03.gif" width="99" height="34" alt=""></dl>
         <dl class="book">
		     <dd><img src="${staticResources}/image/listbook_07.gif" width="121" height="144" alt="">
			     <div class="name" style="font-size:24px; font-weight:1000;">书名：<big>${fn:escapeXml(basicbookitem.name)}</big></div>
				 <small>版本：${fn:escapeXml(basicbookitem.version)}</small><br>
			     <small>出版社：${fn:escapeXml(basicbookitem.publisher)}</small><br>
			     <small>主编：${fn:escapeXml(basicbookitem.chiefEditor)}</small><br>
			     <small>分类：${fn:escapeXml(basicbookitem.category)}</small><br>
			 </dd>
		 </dl>
		 
		 
		 <c:forEach var = "bookitem" items ="${page.records}">
		 
		 
		 <div class="lists">
		     <div class="list"><img src="${staticResources}/image/listbook_11.gif" width="73" height="86" alt="">
			     <a href="ShowBook?beid=${bookitem.beID }">书名：${fn:escapeXml(bookitem.name)}</a><big>价格：</big><b>${fn:escapeXml(bookitem.price)}</b><br>
				 <small>新旧程度：${fn:escapeXml(bookitem.condition)}</small>&nbsp;<small>笔记：${fn:escapeXml(bookitem.hasNote)}</small>
				 
			 </div>
			 <div>
			    <div class="shopper">
			       <small>卖家：</small><small><a href="#">${fn:escapeXml(bookitem.owner.nickName)}</a></small><br>
				   <small>信誉度：${fn:escapeXml(bookitem.owner.creditPoint)}</small>
			    </div>
				<div class="botton">
				   <a href="#"><img src="${staticResources}/image/listbook_14.gif" width="102" height="32" alt=""></a><a href="javascipt:void(0)" onclick = "collect(${bookitem.beID});return false;"> <img src="${staticResources}/image/listbook_16.gif" width="102" height="32" alt=""></a>
				</div>
			 <!-- <input type="hidden" name="redirect_url" id="redirect_url" value="${su:encodeLink(param.redirect_url) }" />	 -->
			 </div>
			 
		 </div>
		 </c:forEach>
<!--一个信息结束-->	 
	
        <div id="page">
		    <ul>
		   
		    
		   
		    
		    <c:choose>
		    <c:when test = "${page.hasPrevious}">
		     <li><a href="?bbid=${param.bbid}&page=1&pageSize=${page.pageSize}">首页</a></li>
            <li><a  href="?bbid=${param.bbid}&page=${page.prePage}&pageSize=${page.pageSize}">上一页</a></li>
		    </c:when>
		    <c:otherwise>
		    <li class = "currentpage">已到首页</li>
		    </c:otherwise>
		    </c:choose>
		  

           
            <c:if test="${page.currentPage-3 gt 0}">
            <li><a href = "?bbid=${param.bbid}&page=${page.currentPage-3}&pageSize=${page.pageSize}">${page.currentPage-3}</a></li>
            </c:if>
            <c:if test="${page.currentPage-2 gt 0}">
            <li><a href = "?bbid=${param.bbid}&page=${page.currentPage-2}&pageSize=${page.pageSize}">${page.currentPage-2}</a></li>
            </c:if>
             <c:if test="${page.currentPage-1 gt 0}">
            <li><a href = "?bbid=${param.bbid}&page=${page.currentPage-1}&pageSize=${page.pageSize}">${page.currentPage-1}</a></li>
            </c:if>
            <li class = "currentpage"><b>${page.currentPage}</b></li>
             
             <c:if test="${page.maxPage - page.currentPage -0 gt 0}">
            <li><a href = "?bbid=${param.bbid}&page=${page.currentPage+1}&pageSize=${page.pageSize}">${page.currentPage+1}</a></li>
            </c:if>
            <c:if test="${page.maxPage - page.currentPage -1 gt 0}">
            <li><a href = "?bbid=${param.bbid}&page=${page.currentPage+2}&pageSize=${page.pageSize}">${page.currentPage+2}</a></li>
            </c:if>
            <c:if test="${page.maxPage - page.currentPage -2 gt 0}">
            <li><a href = "?bbid=${param.bbid}&page=${page.currentPage+3}&pageSize=${page.pageSize}">${page.currentPage+3}</a></li>
            </c:if>
         
          
            
            <c:choose>
		    <c:when test = "${page.hasNext}">
            <li><a href="?bbid=${param.bbid}&page=${page.nextPage}&pageSize=${page.pageSize}">下一页</a></li>
            <li><a href="?bbid=${param.bbid}&page=${page.maxPage}&pageSize=${page.pageSize}">末页</a></li>
		    </c:when>
		    <c:otherwise>
		    <li class = "currentpage">已到末页</li>
		    </c:otherwise>
		    </c:choose>
		    
		    
		  

            </ul>
		</div> 
		
     </div>
     
     
     
</div>
<!--中间部分结束-->
<div id="bottom"><img src="${staticResources}/image/zhuye_47.gif" width="1024" height="86" alt=""></div>

</body>
</html>
